package com.ruoyi.user.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.UserBlacklistMapper;
import com.ruoyi.user.domain.UserBlacklist;
import com.ruoyi.user.service.IUserBlacklistService;

/**
 * 用户黑名单(一对多)Service业务层处理
 * 
 * @author DEREK
 * @date 2023-05-29
 */
@Service
public class UserBlacklistServiceImpl extends ServiceImpl<UserBlacklistMapper, UserBlacklist> implements IUserBlacklistService 
{
    @Autowired
    private UserBlacklistMapper userBlacklistMapper;

    /**
     * 查询用户黑名单(一对多)
     * 
     * @param id 用户黑名单(一对多)主键
     * @return 用户黑名单(一对多)
     */
    @Override
    public UserBlacklist selectUserBlacklistById(Long id)
    {
        return userBlacklistMapper.selectUserBlacklistById(id);
    }

    /**
     * 查询用户黑名单(一对多)列表
     * 
     * @param userBlacklist 用户黑名单(一对多)
     * @return 用户黑名单(一对多)
     */
    @Override
    public List<UserBlacklist> selectUserBlacklistList(UserBlacklist userBlacklist)
    {
        return userBlacklistMapper.selectUserBlacklistList(userBlacklist);
    }

    /**
     * 新增用户黑名单(一对多)
     * 
     * @param userBlacklist 用户黑名单(一对多)
     * @return 结果
     */
    @Override
    public int insertUserBlacklist(UserBlacklist userBlacklist)
    {
        userBlacklist.setCreateTime(DateUtils.getNowDate());
        return userBlacklistMapper.insertUserBlacklist(userBlacklist);
    }

    /**
     * 修改用户黑名单(一对多)
     * 
     * @param userBlacklist 用户黑名单(一对多)
     * @return 结果
     */
    @Override
    public int updateUserBlacklist(UserBlacklist userBlacklist)
    {
        return userBlacklistMapper.updateUserBlacklist(userBlacklist);
    }

    /**
     * 批量删除用户黑名单(一对多)
     * 
     * @param ids 需要删除的用户黑名单(一对多)主键
     * @return 结果
     */
    @Override
    public int deleteUserBlacklistByIds(Long[] ids)
    {
        return userBlacklistMapper.deleteUserBlacklistByIds(ids);
    }

    /**
     * 删除用户黑名单(一对多)信息
     * 
     * @param id 用户黑名单(一对多)主键
     * @return 结果
     */
    @Override
    public int deleteUserBlacklistById(Long id)
    {
        return userBlacklistMapper.deleteUserBlacklistById(id);
    }
}
